Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mesh-normal-vector benchmark array access #1514

Merged
merged 1 commit into from
Nov 11, 2024
Merged

Fix mesh-normal-vector benchmark array access #1514

merged 1 commit into from
Nov 11, 2024

Conversation

zeux
Copy link
Collaborator

@zeux zeux commented Nov 9, 2024

mesh-normal-scalar correctly fills sequential values in the output for triangle cone function, but mesh-normal-vector accidentally reuses the loop index, which results in writes to every third index of the array (1, 4, etc.).

This is both slower (as the table turns into a hash map), and incorrect, especially as we have a scalar version of the benchmark that does the right thing.

Note: there's a bunch of inefficiencies in the benchmark code that I have not fixed (around field access mostly, e.g. writing to v.n and then immediately reading it again). These are not ideal for performance, but they can be valuable to keep as is because this redundancy is common in real-world code, and it would be nice to see codegen optimizations eliminating most of that overhead. This one, however, is a straight up bug, and sparse arrays should not really be the thing this benchmark hits.

mesh-normal-scalar correctly fills sequential values in the output for
triangle cone function, but mesh-normal-vector accidentally reuses the
loop index, which results in writes to every third index of the array
(1, 4, etc.).

This is both slower (as the table turns into a hash map), and incorrect,
especially as we have a scalar version of the benchmark that does the
right thing.
@vrn-sn vrn-sn merged commit 53e6e4b into master Nov 11, 2024
8 checks passed
@vrn-sn vrn-sn deleted the vecbench-fix branch November 11, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants